-- GENERATED SPELL FOR [Spectral Trainee] --


function spell0_16127(pUnit, Event) --@Arcane Explosion,Self--
pUnit:FullCastSpellOnTarget(27989,pUnit)
pUnit:RegisterEvent('Sorts_16127', 600, 1)
end

function spell1_16127(pUnit, Event) --@Arcane Explosion,Self--
pUnit:FullCastSpellOnTarget(56407,pUnit)
pUnit:RegisterEvent('Sorts_16127', 613, 1)
end

function Sorts_16127(pUnit, Event)
local choix_sorts_16127 = math.random(0, 1)
if choix_sorts_16127 == 0 then
pUnit:RegisterEvent('spell0_16127', 1, 1)
end
if choix_sorts_16127 == 1 then
pUnit:RegisterEvent('spell1_16127', 1, 1)
end
end

function mob16127_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16127', math.random(1500, 3000), 1)
end

function mob16127_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16127_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16127_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16127, 1, 'mob16127_Action')
RegisterUnitEvent(16127, 2, 'mob16127_Leave')
RegisterUnitEvent(16127, 3, 'mob16127_Kill')
RegisterUnitEvent(16127, 4, 'mob16127_Die')
